package com.mh.www.mh_frame.view.fragment;

import android.graphics.Color;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.mh.www.mh_frame.R;
import com.mh.www.mh_frame.util.ToastUtil;
import com.mh.www.mh_frame.view.activity.MeetingSummaryActivity;
import com.mh.www.mh_frame.view.activity.StandardActivity;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 我的日常
 * Created by lenovo on 2018/4/16.
 */

public class MyDailyFragment extends BaseFragment {
    @BindView(R.id.iv_head_icon)
    ImageView mIvHeadIcon;
    @BindView(R.id.ll_1)
    RelativeLayout mLl1;
    @BindView(R.id.tv_name)
    TextView mTvName;
    @BindView(R.id.tv_department)
    TextView mTvDepartment;
    @BindView(R.id.tv_time)
    TextView mTvTime;
    @BindView(R.id.rl_1)
    RelativeLayout mRl1;
    @BindView(R.id.iv_set)
    ImageView mIvSet;
    @BindView(R.id.iv_msg)
    ImageView mIvMsg;
    @BindView(R.id.tv_notice)
    TextView mTvNotice;
    @BindView(R.id.tv_message)
    TextView mTvMessage;
    @BindView(R.id.rl_2)
    RelativeLayout mRl2;
    @BindView(R.id.tv_check_work)
    TextView mTvCheckWork;
    @BindView(R.id.tv_leave_approval)
    TextView mTvLeaveApproval;
    @BindView(R.id.tv_business_travel)
    TextView mTvBusinessTravel;
    @BindView(R.id.construction_site)
    TextView mConstructionSite;
    @BindView(R.id.tv_journal)
    TextView mTvJournal;
    @BindView(R.id.tv_create_journal)
    TextView mTvCreateJournal;
    @BindView(R.id.tv_specification)
    TextView mTvSpecification;
    @BindView(R.id.tv_notification_letter)
    TextView mTvNotificationLetter;
    @BindView(R.id.tv_meeting_summary)
    TextView mTvMeetingSummary;
    @BindView(R.id.tv_work_log)
    TextView mTvWorkLog;
    @BindView(R.id.tv_daily_look)
    TextView mTvDailyLook;
    @BindView(R.id.tv_weekly_look)
    TextView mTvWeeklyLook;
    @BindView(R.id.tv_monthly_look)
    TextView mTvMonthlyLook;
    @BindView(R.id.ll3)
    LinearLayout mLl3;
    @Override
    protected int getLayoutID() {
        return R.layout.fragment_my_daily;
    }

    @Override
    protected void initFragment() {
        /**
         * 未处理日志数量
         */
        initSpannable();

    }

    private void initSpannable() {
        SpannableStringBuilder builder = new SpannableStringBuilder(mTvMessage.getText().toString());
        ForegroundColorSpan redSpan = new ForegroundColorSpan(Color.RED);
        builder.setSpan(redSpan, 2, 3, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        mTvMessage.setText(builder);
    }

    @OnClick({R.id.iv_head_icon, R.id.ll_1, R.id.iv_set, R.id.iv_msg, R.id.rl_2, R.id.tv_check_work, R.id.tv_leave_approval, R.id.tv_business_travel, R.id.construction_site, R.id.tv_journal, R.id.tv_create_journal, R.id.tv_specification, R.id.tv_notification_letter, R.id.tv_meeting_summary, R.id.tv_work_log, R.id.tv_daily_look, R.id.tv_weekly_look, R.id.tv_monthly_look})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.iv_head_icon:
                //头像
                ToastUtil.showShortToast("头像");
                break;
            case R.id.iv_set:
                //设置
                break;
            case R.id.iv_msg:
                //消息
                break;
            case R.id.rl_2:
                //通知
                break;
            case R.id.tv_check_work:
                //考勤
                break;
            case R.id.tv_leave_approval:
                //请假审批
                break;
            case R.id.tv_business_travel:
                //出差
                break;
            case R.id.construction_site:
                //施工现场
                break;
            case R.id.tv_create_journal:
                //创建日志
                break;
            case R.id.tv_specification:
                //标准规范
                goTo(StandardActivity.class);
                break;
            case R.id.tv_notification_letter:
                //通知公函
                break;
            case R.id.tv_meeting_summary:
                //会议纪要
                goTo(MeetingSummaryActivity.class);
                break;
            case R.id.tv_work_log:
                //工作日志
                break;
            case R.id.tv_daily_look:
                //日报查看
                break;
            case R.id.tv_weekly_look:
                //周报查看
                break;
            case R.id.tv_monthly_look:
                //月报查看
                break;
        }
    }
}
